package com.molichuxing.gateway.property;

/**
 * 
 * OSS文件夹枚举
 *
 */
public enum OSSFileFolderEnum {

	/**
	 *用户
	 */
	USER (1, "user"),

	/**
	 *经销商
	 */
	DEALER (2, "dealer"),

	/**
	 *车辆
	 */
	VEHICLE (3, "vehicle"),

	ADVERTISING(4, "advertising"),

	ACCIDENT(5, "accident"),

	MAINTENANCE(6, "maintenance"),

	CHECK(7, "check"),

	CONTRACT(8, "contract"),

	INVOICE(9, "invoice"),

	FINANCE(10, "finance"),

	PURCHASEINVOICE(11, "purchaseinvoice"),

	FACTORYCERT(12, "factorycert"),

	UNIFORMITYCERT(13, "uniformitycert"),

	/**
	 * 交强险
	 */
	INSURANCE(14, "insurance"),

	/**
	 * 商业险
	 */
	COMMERCIAL(15, "commercial")
	;




	int value;
	String name;

	OSSFileFolderEnum(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}


	/**
	 * 通过value获取枚举的name
	 * 
	 * @param value
	 * @return
	 */
	public static String getName(int value) {
		OSSFileFolderEnum enumerate = getEnum(value);
		return enumerate == null ? null : enumerate.getName();
	}

	/**
	 * 通过value获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static OSSFileFolderEnum getEnum(int value) {
		for (OSSFileFolderEnum enumerate : OSSFileFolderEnum.values()) {
			if (enumerate.getValue() == value) {
				return enumerate;
			}
		}
		return null;
	}
}
